package com.dina.saas.peccancy.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DateUtil {
	public static String getCurrentDate() {
		Calendar day = Calendar.getInstance();
		day.add(Calendar.DATE, 0);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//
		String date = sdf.format(day.getTime());
		return date;
	}

	public static String getLastYearDate() {
		Calendar day = Calendar.getInstance();
		day.setTimeInMillis(day.getTime().getTime() -  365*24 * 60 * 60
				* 1000l*2l);
		day.add(Calendar.DATE, 0);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//
		String date = sdf.format(day.getTime());
		return date;
	}
	
}
